/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "base/files/file_util.h"
#include "base/path_service.h"
#include "chrome/common/chrome_paths_internal.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace chrome {

class ChromePathsOhosTest : public testing::Test {};

TEST_F(ChromePathsOhosTest, TestCacheDirectorySuccess) {
  base::FilePath profile_dir(FILE_PATH_LITERAL("/user/profile"));
  base::FilePath result;

  base::FilePath cache_dir(FILE_PATH_LITERAL("/cache"));
  EXPECT_TRUE(base::PathService::Get(base::DIR_CACHE, &cache_dir));
  GetUserCacheDirectory(profile_dir, &result);

  base::FilePath expected_result = cache_dir.Append(profile_dir.BaseName());
  EXPECT_EQ(result, expected_result);
}

} // namespace chrome